//
//  IFAudioPlayerManager.h
//  IfengNews
//
//  Created by lihongdan on 14-7-9.
//
//

#import <Foundation/Foundation.h>
#import "STKAudioPlayer.h"


@protocol IFAudioPlayerManagerDelegate <NSObject>
@optional
- (void)audioRemoteControlReceivedWithEvent:(UIEvent *)event;

- (void)playingStstusTotalTime:(double) total current:(double)current;

- (void)audioProgerss:(float)progerss;

- (void)finishwithReason:(STKAudioPlayerStopReason)stopReason andProgress:(double)progress andDuration:(double)duration;

- (void)willStop:(NSString *)tag;

- (void)willpause:(NSString *)tag;

- (NSString *)getAudioTitle;

@end

@interface IFAudioPlayerManager : UIResponder<STKAudioPlayerDelegate>

@property (nonatomic,weak) id<IFAudioPlayerManagerDelegate> delegate;
@property (nonatomic,weak) id<IFAudioPlayerManagerDelegate> delegate2;
@property (nonatomic,assign)BOOL isAudioShow;
@property (nonatomic,strong) STKAudioPlayer *player;
@property (nonatomic,strong)NSString *audioUrl;
@property (nonatomic,strong)NSString *tag;


+ (IFAudioPlayerManager *) shareInstance;

- (void)playWithURLString:(NSString *)url;

- (void)stop;

- (void)remoteControlReceivedWithEvent:(UIEvent *)event;

- (BOOL)isPlaying;

- (void)registeiPod:(UIResponder*)responder;

//注销iPod功能
- (void)unRegisteiPod:(UIResponder*)responder;

- (void)checkRegister;

- (BOOL)isPause;

- (void)pause;

- (void)resume;

- (void)openAudioWindow;

- (void)closeAudioWindow;

- (BOOL)isRunning;

-(void) seekToTime:(double)value;

- (BOOL)isStop;

- (void)play;

- (void)playWithURLString:(NSString *)url title:(NSString *)title;

- (NSString *)formatSecond:(float)second;

- (void)openAudioWindowWith:(NSString *)title ItemId:(NSString *)itemId;

- (void)hiddenStateWindow;

- (void)notHiddenStateWindwo;

-(void)closeAudioStateWindow;

@end
